/*
 * Project Name: jmax
 * File Name: RtEventHandler.java
 * Copyright: Copyright(C) 1985-2015 ZKTeco Inc. All rights reserved.
 */
package com.xdtech.hotel.monitor;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.xdtech.hotel.protocol.server.SendServer;
import com.xdtech.hotel.util.RedisUtils;

/**
 * TODO 一句话功能简述，请确保和下面的block tags之间保留一行空行
 * <p>
 * TODO 功能详细描述，若不需要请连同上面的p标签一起删除
 * 
 * @author <a href="max.zheng@zkteco.com">郑志雄</>
 * @version TODO 添加版本
 * @see 相关类或方法，不需要请删除此行
 * @since 2015-4-23 下午5:08:14
 */
public class RtEventHandler
{
	private static Log log = LogFactory.getLog(RtEventHandler.class);
	public static void runingHandlerRtEventThread() {
		new Thread(new Runnable()
		{
			
			@Override
			public void run()
			{
				while (true)
				{
					try
					{
						String rtContent = RedisUtils.getDevRtEvent();
				 		if (StringUtils.isNotBlank(rtContent))
						{
							log.info("处理设备上来实时数据......:"+rtContent);
						}
				 		else
						{
							Thread.sleep(5000);
						}
					}
					catch (Exception e)
					{
						log.error("Handler Device Running Event error", e);
					}
				}
			}
		}, "RtEventHandlerThread").start();
	}
}
